package com.leifeng.security.dto;

import java.util.Date;

import javax.validation.constraints.Past;

import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.NotEmpty;

import com.fasterxml.jackson.annotation.JsonView;
import com.leifeng.security.validator.MyConstraint;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
public class User {
	
	public interface UserSimpleView{};//用户简单视图
	public interface UserDetailView extends UserSimpleView{};//用户详细视图
	
	
	@JsonView(UserSimpleView.class)
	@ApiModelProperty(value="用户奶酪起始值")
	private Integer id;
	
	@JsonView(UserSimpleView.class)
	//@NotBlank
	@MyConstraint(message = "这是一个测试")
	@ApiModelProperty(value="用户姓名")
	private String userName;
	
	@JsonView(UserDetailView.class)
	@NotEmpty(message="密码不能为空！")
	@ApiModelProperty(value="用户密码")
	private String passWord;
	
	@JsonView(UserSimpleView.class)
	@Past
	@ApiModelProperty(value="用户生日")
	private Date birthday;
	

	public User() {
		super();
	}


	public User(Integer id, String userName, String passWord, Date birthday) {
		super();
		this.id = id;
		this.userName = userName;
		this.passWord = passWord;
		this.birthday = birthday;
	}
	
	
	
	

}
